<template>
         <template v-for="item in props.routes" :key="item.path">
    <!-- <template v-if="!item.meta?.hide"> -->
    <template v-if="!item.children || item.children.length < 1">
      <el-menu-item :style="{color: stort.themeCloor}" :index="item.path">
        <el-icon>
          <component :is="item.meta?.icon" />
        </el-icon>
        <span>{{ item.meta?.title }}</span>
      </el-menu-item>
    </template>

    <el-sub-menu v-else :index="item.path">
      <template #title>
        <el-icon>
          <component :is="item.meta?.icon" />
        </el-icon>
        <span>{{ item.meta?.title }}</span>
      </template>
      <IcoMenu :routes="item.children" />
    </el-sub-menu>

    <!-- </template> -->
  </template>
</template>

<script setup lang="ts">
import { watch } from 'vue'
import { useCounterStore } from '@/stores/Shi';
const props = defineProps(['routes'])
const stort = useCounterStore()
// console.log(props.routes, '-----')

// watch(
//   () => props.routes,
//   (newValue, oldValue) => {
//     console.log('routes被修改了', newValue)
//   },
//   {
//     immediate: true
//   }
// )
</script>